{% extends "base.html" %}

{% block stylesheets %}
{% endblock %}

{% block content %}
<div class="jumbotron">
    <div class="container">
        <h1>注册</h1>
    </div>
</div>
<div class="container">
    <div class="row">
        <div class="col-md-6 offset-md-3">
            {% include "components/errors.html" %}

            {% if integrations.mlc() %}
            <a class="btn btn-secondary btn-lg btn-block" href="{{ url_for('auth.oauth_login') }}">
                使用 Major League Cyber 登录
            </a>

            <hr>
            {% endif %}

            {% with form = Forms.auth.RegistrationForm() %}
            {% from "macros/forms.html" import render_extra_fields %}
            <form method="post" accept-charset="utf-8" autocomplete="off" role="form">
                <div class="form-group">
                    <b>{{ form.name.label }}</b>
                    {{ form.name(class="form-control", value=name) }}
                    <small class="form-text text-muted">
                        用于登录使用
                    </small>
                </div>
                <div class="form-group">
                    <b>{{ form.email.label }}</b>
                    {{ form.email(class="form-control", value=email) }}
                    <small class="form-text text-muted">
                        作为账户找回凭证
                    </small>
                </div>
                <div class="form-group">
                    <b>{{ form.password.label }}</b>
                    {{ form.password(class="form-control", value=password) }}
                    <small class="form-text text-muted">
                        登录您账户的密码
                    </small>
                </div>
                <hr style="border: 1px solid black;">
                <div class="form-group">
                    <b>{{ form.stu_name.label }}</b>
                    {{ form.stu_name(class="form-control", value=stu_name) }}
                    <small class="form-text text-muted">
                        您的真实姓名
                    </small>
                </div>
                <div class="form-group">
                    <b>{{ form.stu_id.label }}</b>
                    {{ form.stu_id(class="form-control", value=stu_id) }}
                    <small class="form-text text-muted">
                        您的学号(如:202xxxxxxxxx)
                    </small>
                </div>
                <div class="form-group">
                    <b>{{ form.stu_class.label }}</b>
                    {{ form.stu_class(class="form-control", value=stu_class) }}
                    <small class="form-text text-muted">
                        您所在班级(格式:年级+班级 &nbsp;&nbsp;&nbsp;如: 21级软件工程xx班)
                    </small>
                </div>
                {{ form.nonce() }}

                {{ render_extra_fields(form.extra) }}

                <div class="row pt-3">
                    <div class="col-md-12">
                        {{ form.submit(class="btn btn-md btn-primary btn-outlined float-right") }}
                    </div>
                </div>

                {% if Configs.tos_or_privacy %}
                <div class="row pt-3">
                    <div class="col-md-12 text-center">
                        <small class="text-muted text-center">
                            注册即表示您同意
                            <a href="{{ Configs.privacy_link }}" rel="noopener" target="_blank">隐私政策</a>
                            和 <a href="{{ Configs.tos_link }}" rel="noopener" target="_blank">服务条款</a>
                        </small>
                    </div>
                </div>
                {% endif %}
            </form>
            {% endwith %}
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
{% endblock %}
